<!--
 * @Author: 许警 11378748333@
 * @Date: 2025-03-19 15:28:04
 * @LastEditors: 许警 11378748333@
 * @LastEditTime: 2025-03-27 15:31:22
 * @FilePath: /hsxlsystem/src/views/business/huifang/user_evaluate/components/detailModal.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <a-modal v-model:visible="modalVisible" title="详情" width="80%" :footer="null" @cancel="cancle" class="user-modal">
    <a-card title="基本信息">
      <a-descriptions bordered>
        <a-descriptions-item label="订单号">{{ report.number }}</a-descriptions-item>
        <a-descriptions-item label="用户姓名">{{ report.userName }}</a-descriptions-item>
        <a-descriptions-item label="服务名称">{{ report.serviceName }}</a-descriptions-item>
        <a-descriptions-item label="评价时间">{{ report.createdAt }}</a-descriptions-item>
        <a-descriptions-item label="所属渠道">{{ report.institution }}</a-descriptions-item>
        <a-descriptions-item label="服务护士">{{ report.nurseName }}</a-descriptions-item>
        <a-descriptions-item label="护士ID">{{ report.nurseId }}</a-descriptions-item>
        <a-descriptions-item label="护士专业性评分">{{ report.nurseSpecialityScore }}</a-descriptions-item>
        <a-descriptions-item label="护士服务态度评分">{{ report.nurseAttitudeScore }}</a-descriptions-item>
        <a-descriptions-item label="护士准时评分">{{ report.nurseOnTime }}</a-descriptions-item>
        <a-descriptions-item label="平台服务人员评分" :span="3">{{ report.dispatchScore }}</a-descriptions-item>
        <a-descriptions-item label="备注" :span="3">{{ report.nurseOpinion }}</a-descriptions-item>
      </a-descriptions>
    </a-card>

    <!-- <a-form :label-col="{ span: 3 }" :wrapper-col="{ span: 19 }">
      <a-form-item label="对派单人员是否满意">{{ statusText[report.dispatchIsSatisfaction] }}</a-form-item>
      <a-form-item v-if="report.dispatchIsSatisfaction == 2" label="反馈资料">
        <a-textarea v-model:value="report.dispatchOpinion" auto-size :disabled="true" />
      </a-form-item>
      <a-form-item label="对派服务护士是否满意">{{ statusText[report.nurseIsSatisfaction] }}</a-form-item>
      <a-form-item v-if="report.nurseIsSatisfaction == 2" label="反馈资料">
        <a-textarea v-model:value="report.nurseOpinion" auto-size :disabled="true" />
      </a-form-item>
    </a-form> -->
  </a-modal>
</template>
<script>
import { ref, computed } from 'vue'
import { statusTextObj } from '../data'

import { selectEvaluateByNumbert } from '@/api/buisness/index'
export default {
  props: {
    visible: {
      type: Boolean,
      default: false
    },
    number: {
      default: null
    }
  },
  setup(props, { emit, attrs }) {
    const report = ref({})
    const modalVisible = computed({
      get: () => {
        if (props.visible) {
          init()
        }
        return props.visible
      },
      set: val => {
        emit('update:visible', val)
      }
    })
    const statusText = statusTextObj
    const cancle = () => {
      modalVisible.value = false
    }

    async function init() {
      let form = {
        number: props.number
      }
      let res = await selectEvaluateByNumbert(form)
      if (res.success) {
        report.value = res.object
      }
    }

    return {
      modalVisible,
      labelCol: {
        style: {
          width: '100px',
          fontWeight: 'bolder'
        }
      },
      wrapperCol: {
        span: 20,
        offset: 1
      },
      cancle,
      report,
      statusText
    }
  }
}
</script>
<style scoped>
.ant-form-item {
  margin-bottom: 10px;
}
.ant-form {
  margin-top: 32px;
}
</style>
